package com.ybxx.base.model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;

import com.ybxx.config.model.HousingProperty;
import com.ybxx.core.model.BaseModel;
import com.ybxx.core.util.DateUtil;

@Entity
@Table(name="tbl_base_residents")
public class Residents extends BaseModel {
	@Id
	private String rcode;
	@ManyToOne(targetEntity=Room.class,fetch=FetchType.LAZY)
	@JoinColumn(name="rid",referencedColumnName="rid") 
	private Room room;
	@ManyToOne(targetEntity=HousingProperty.class,fetch=FetchType.LAZY)
	@JoinColumn(name="hpid",referencedColumnName="hpid") 
	private HousingProperty property;
	private String rname;
	private String sex;
	private String icard;
	private String tel;
	private String worktime;
	private String txtime;
	private String company;
	private String cqqk;
	private String gfk;
	private String content;
	private String state;
	private String rnum;
	
	
	
	/**
	 * 
	 */
	public Residents() {
	}
	
	
	/**
	 * @param rcode
	 */
	public Residents(String rcode) {
		super();
		this.rcode = rcode;
	}


	public String getRcode() {
		return rcode;
	}
	public void setRcode(String rcode) {
		this.rcode = rcode;
	}
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	public HousingProperty getProperty() {
		return property;
	}
	public void setProperty(HousingProperty property) {
		this.property = property;
	}
	public String getRname() {
		return rname;
	}
	public void setRname(String rname) {
		this.rname = rname;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getIcard() {
		return icard;
	}
	public void setIcard(String icard) {
		this.icard = icard;
	}
	public String getTel() {
		return tel;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public String getWorktime() {
		if(StringUtils.isNotEmpty(worktime)){
			return worktime.substring(0,10);
		}
		return worktime;
	}
	public void setWorktime(String worktime) {
		if(StringUtils.isNotEmpty(worktime)){
			this.worktime = worktime;
		}
	}
	public String getTxtime() {
		if(StringUtils.isNotEmpty(txtime)){
			return txtime.substring(0,10);
		}
		return txtime;
	}
	public void setTxtime(String txtime) {
		if(StringUtils.isNotEmpty(txtime)){
			this.txtime = txtime;
		}
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getCqqk() {
		return cqqk;
	}
	public void setCqqk(String cqqk) {
		this.cqqk = cqqk;
	}
	public String getGfk() {
		return gfk;
	}
	public void setGfk(String gfk) {
		this.gfk = gfk;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getRnum() {
		return rnum;
	}
	public void setRnum(String rnum) {
		this.rnum = rnum;
	}
	
	
	
	
}
